package runtimeconstant;

import java.util.ArrayList;
import java.util.List;

/**
 * @author ZhengDp
 * @Date 2023/5/12 17:24
 * @Description 演示 StringTable的位置
 * jdk8 : -Xmx10m -XX:-UseGCOverheadLimit
 * jdk6 : -XX:MaxPermSize=10m
 */
public class StringTable_Demo2 {
    public static void main(String[] args) {
        List<String> list = new ArrayList<>();
        int i=0;
        try {
            for (int i1 = 0; i1 < 2600000; i1++) {
                list.add(String.valueOf(i1).intern());
                i++;
            }
        }finally {
            System.out.println(i);
        }

    }
}
